package 剑指offer.Month7_07.day14;

public class 连续子数组的最大和 {
    public int FindGreatestSumOfSubArray(int[] array) {
        int res = Integer.MIN_VALUE;
        int now = 0;
        for (int i = 0; i < array.length; i++) {
            now = Math.max(array[i],now + array[i]);
            res = Math.max(res,now);
        }
        return res;
    }
}
